package com.runshu.newsmartark.mvp.presenter;


import com.runshu.newsmartark.mvp.contract.LogsManagerContract;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.MyCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/8/10
 * @decs：
 */

public class LogsManagerPresenter implements LogsManagerContract.Presenter {
    private LogsManagerContract.View view;
    private LogsManagerContract.Model model;

    public LogsManagerPresenter(LogsManagerContract.View view, LogsManagerContract.Model model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void getLogsManagerList(String userCode, String rfidType, String timeBucket, String startTime, String endTime, int pageSize, int pageNum) {
        model.getLogsManagerList(userCode, rfidType, timeBucket, startTime, endTime, pageSize, pageNum, new MyCallBack() {
            @Override
            public void onSuccess(ResponseBean data) {
                view.OnGetLogsManagerList(data);
            }

            @Override
            public void onError(ResponseBean data) {
                view.onError(data.getMessage());
            }
        });
    }
}